package org.chen.flight.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.chen.common.task.TaskExecutionLogEntity;

import java.util.List;

/**
 * 任务执行日志Mapper
 */
@Mapper
public interface TaskExecutionLogMapper extends BaseMapper<TaskExecutionLogEntity> {
    
    /**
     * 根据任务ID查询执行日志
     */
    @Select("SELECT * FROM flight_task_execution_log WHERE task_id = #{taskId} ORDER BY execute_time DESC LIMIT #{limit}")
    List<TaskExecutionLogEntity> findByTaskId(@Param("taskId") String taskId, @Param("limit") int limit);
}